/**
 * 用类名绑定弹出层
 */
var j_open,icon;
layui.use(['layer', 'jquery','upload'], function () {
    var layer = layui.layer,
        upload = layui.upload,
        Jquery = layui.jquery;

    /**
     * 图标库弹出层
     */
    Jquery(document).on('click', '.icon-library', function () {
        icon = layer.open({
            type: 2,
            area: ['80%', '80%'],
            content: ['/admin/Index/icon'],
            scrollbar: true
        })
    });

    /**
     * 弹出层
     */
    Jquery(document).on('click', '.j-open', function () {
        let _title = $(this).attr('j-title')
            , _href = $(this).attr('j-href')
            , _type = $(this).attr('j-type')
            , _config = $(this).attr('j-config')
            , config = {
                shadeClose:true,
                isOutAnim:true,
        };
        config = $.extend(JSON.parse(_config),config);
        config.title = _title;
        config.type = Number(_type);

        if(_type == 2){
            config.content = _href;
        }

        j_open = layer.open(config);
    })
})